'''
Author: xubing
Date: 2021-07-28 15:30:55
LastEditors: xubing
LastEditTime: 2021-07-28 15:42:21
Description: 自己写的logger
'''

import logging


class Logger:
    def __init__(self) -> None:
        logging.basicConfig(level=logging.DEBUG,  # 设置logger的等级
                            datefmt='%Y-%m-%d %H:%M:%S',  # 设置日期格式
                            format='[%(asctime)s]-[%(levelname)s]:%(message)s')  # 设置输出格式

    def debug(self, msg):
        logging.debug(msg)

    def info(self, msg):
        logging.info(msg)

    def warning(self, msg):
        logging.warning(msg)

    def error(self, msg):
        logging.error(msg)


if __name__ == '__main__':
    logger = Logger()
    logger.info('一起哈皮')
